<html><head><title>Bias a vector of allele ratios (LGS)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="Rchm.css">
</head>
<body>

<table width="100%"><tr><td>biasLGS(LGS)</td><td align="right">R Documentation</td></tr></table><object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="keyword" value="R:   biasLGS">
<param name="keyword" value=" Bias a vector of allele ratios (LGS)">
</object>


<h2>Bias a vector of allele ratios (LGS)</h2>


<h3>Description</h3>

<p>
<code>biasLGS</code> reproduces the technical imprecision in the quantification of the allele ratios by adding a random value to each element of a vector of allele ratios.
</p>


<h3>Usage</h3>

<pre>
biasLGS(simLGS = simLGS, bias = 0.02, meanBias = 0)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>simLGS</code></td>
<td>
An LGS list output of <code><a href="simLGS.html">simLGS</a></code> or a vector of marker allele ratios. </td></tr>
<tr valign="top"><td><code>bias</code></td>
<td>
Average value added or subtracted to the marker allele ratios. </td></tr>
<tr valign="top"><td><code>meanBias</code></td>
<td>
Average bias across all markers. </td></tr>
</table>

<h3>Details</h3>

<p>
This function uses <code><a onclick="findlink('stats', 'Normal.html')" style="text-decoration: underline; color: blue; cursor: hand">rnorm</a></code> with <code>mean=meanBias</code> and <code>sd=bias</code>. Values above 1 and below 0 are reset to 1 and 0 respectively.
</p>


<h3>Value</h3>

<p>
If <code>simLGS</code> is an LGS list then <code>biasLGS</code> will create a new list equal to the input one but with <code>simLGS$ChrMap$LGS</code> replaced by the biased value and the original <code>simLGS$ChrMap$LGS</code> renamed to <code>simLGS$ChrMap$unbiasedLGS</code>.
If simLGS is a vector, then a biased vector of the same length will be returned.</p>

<h3>Author(s)</h3>

<p>
Dario Beraldi &lt;<a href="mailto:dario.beraldi@ed.ac.uk">dario.beraldi@ed.ac.uk</a>&gt;
</p>


<h3>Examples</h3>

<pre>
# Bias a matrix of allele ratios (rows= scans, columns= loci)
(mlgs&lt;- matrix(nrow= 3, ncol= 10, data= runif(n=3*10, min=0, max=1)))
(mlgsB&lt;- t(apply(mlgs, 1, function(x) biasLGS(x, bias=0.02))))
</pre>

<script Language="JScript">
function findlink(pkg, fn) {
var Y, link;
Y = location.href.lastIndexOf("\\") + 1;
link = location.href.substring(0, Y);
link = link + "../../" + pkg + "/chtml/" + pkg + ".chm::/" + fn;
location.href = link;
}
</script>


<hr><div align="center">[Package <em>LGS</em> version 0.9 <a href="00Index.html">Index]</a></div>

</body></html>
